<?php
class Driver__Factory
{
    private static $_drivers;

    /**
     *
     * @param string $driver_name
     * @return Driver__Core
     */
    public static function creator($driver_name)
    {
        if (!isset(self::$_drivers[$driver_name])) {
            self::$_drivers[$driver_name] = new $driver_name;
        }
        return self::$_drivers[$driver_name];
    }

    /**
     * @return Driver__Backend__Memcache
     */
    public static function memcache_creator()
    {
        return self::creator('memcache');
    }

    /**
     * @return Driver__Backend__Phprpc
     */
    public static function phprpc_creator()
    {
    	return self::creator('phprpc');
    }
}
